<template>
    <div id="main"></div>
</template>
<script lang="ts" setup>
import { onMounted } from "vue";
import * as echarts from "echarts"

type EChartsOption = echarts.EChartsOption;
// 基于准备好的dom，初始化echarts实例
onMounted(() => {
    var myChart = echarts.init(document.getElementById('main'));
    // 绘制图表
    myChart.setOption({
        title: {
            text: '商品销售情况'
        },
        tooltip: {},
        xAxis: {
            type: 'category',
            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
            type: 'value'
        },
        series: [
            {
                data: [120, 200, 150, 80, 70, 110, 130],
                type: 'bar'
            }
        ]
    });
})
	// option && myChart.setOption(option);




</script>
<style scoped>
#main {
    height: 500px;
}
</style>